function isHave(){
    var arr = [1,2,3,4,5,6,7]
    var searchNumber = parseInt(prompt('请输入想要搜索的数'))
    var ishave = false
    for(let i = 0; i<arr.length; i++){
        if(searchNumber == arr[i]){
            ishave = true
        }
    }
    if(ishave == true){
        alert('Yes !')
    }else{
        alert("Not have .")
    }
}

//选择排序
function choiceSeach(){
    var arr = [2,4,3,7,6,5,1,8]

    for(let i = 0; i<arr.length-1; i++){
        let min = arr[i]
        let tmp = i
        for(let j = i+1; j<arr.length; j++){
            if(arr[j] < min){
                min = arr[j]
                tmp = j
            }
        }
        arr[tmp] = arr[i]
        arr[i] = min
    }

    for(let i = 0; i<arr.length; i++)[
        console.log(arr[i] + ",")
    ]
}

function stringTest(){
    var str1 = new String("abcd")
    var str2 = new String("efgh11112222")
    console.log(str1.length)
    console.log(str1.charAt(1))
    console.log(str1.charCodeAt(1))
    console.log(str1.concat(str2))
    console.log(str1.slice(2,4))
    console.log(str.substring(2,4))
    console.log(str.substr(2,5))
    console.log(str)
    console.log()
}